package com.hdu.pyl.service.coldBoot;

import com.hdu.pyl.mappper.NewScoreByUserMapper;
import com.hdu.pyl.mappper.UserTagsMapper;
import com.hdu.pyl.pojo.NewScoreByUser;
import com.hdu.pyl.pojo.UserTags;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class UserColdBootServiceImpl implements UserColdBootService{
    @Autowired
    private NewScoreByUserMapper newScoreByUserMapper;
    @Autowired
    private UserTagsMapper userTagsMapper;
    //用户是否为冷启动
    @Override
    public boolean isUserColdBoot(Integer userId) {
        List<NewScoreByUser> newScoreByUserList=newScoreByUserMapper.getNewScoreByUserId(userId);
        if (null==newScoreByUserList||newScoreByUserList.size()==0){
            return true;
        }else {
            return false;
        }
    }
    //用户是否存在用户标签
    @Override
    public boolean hasUserTags(Integer userId) {
        UserTags userTags=userTagsMapper.findByUserId(userId);
        if (null==userTags){
            return true;
        }
        return false;
    }
}
